<?if(!empty($levels)):?>
	<?	foreach((object)$levels as $k => $v):?>
		<?$scurriculum = $curriculum($v->level_id);?>
		<div id="curriculum<?=$v->level_id;?>" class="reveal-modal">
		  <h3>Subject Curriculum for <?=$v->level_desc;?></h3>
			
			<?if($scurriculum == FALSE):?>
				<div class="alert alert-notice">
					<p><strong>Sorry!</strong></p>
					<p>No subjects assigned for this Grade Level / Curriculum. Click the link below to set curriculum.</p>
					<a href="<?=site_url('set-curriculum/'.$v->level_id);?>" class="confirm btn btn-primary" title="Continue?">Set Curriculum for <?=$v->level_desc;?></a>
				</div>
			<?else:?>
				<table style="width:100%;">
					<thead>
						<tr>
							<td>Subject Name</td>
							<td>Subject Code</td>
						</tr>
					</thead>
					<tbody>
						<?foreach($scurriculum as $k=>$v):?>
						<tr>
							<td><?=$v->subject_name;?></td>
							<td><?=$v->subject_desc;?></td>
						</tr>
						<?endforeach;?>
					</tbody>
				</table>
			<?endif;?>
		  
		  
		  <a class="close-reveal-modal">&#215;</a>
		</div>
	<?endforeach;?>
<?endif;?>

<div>
	<h5>Set Curriculum</h5>
	<hr>
	<table class="table">
		<thead>
			<tr>
				<td>Grade Level</td>
				<td>Grade Level Code</td>
				<td>Grade Level Category</td>
				<td class="center">Actions</td>
			</tr>
		</thead>
		
		<?if(!empty($levels)):?>
			<?foreach($levels as $k => $v):?>
				<tr>
					<td><?=$v->level_desc;?></td>
					<td><?=$v->level_code;?></td>
					<td><?=$v->level_category;?></td>
					<td class="center">
						<a href="<?=site_url('set-curriculum/'.$v->level_id);?>" class="confirm btn btn-mini btn-success" title="Continue to set curriculum for <?=$v->level_desc;?>?">set</a>
						<a href="#" data-reveal-id="curriculum<?=$v->level_id;?>" class="btn btn-mini">view</a>
					</td>
				</tr>
			<?endforeach;?>
		<?else:?>
		
		<?endif;?>
	</table>
</div>